package net.cyndeline.itemEventFactory

import net.cyndeline.entitySystem.EntityRef
import net.cyndeline.entitySystem.Event

class ActionResultStorage extends ActionResultConfig {
  private var eventStore: Map[EntityRef, List[Event]] = Map()
  
  override def events = eventStore.toList
  
  override def addEvent(target: EntityRef, event: Event) {
    val currentEvents = eventStore.get(target) getOrElse Nil
    
    if (!currentEvents.contains(event)) {
      eventStore += (target -> (currentEvents :+ event))
    }
  }
}